<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:cc="http://java.sun.com/jsf/composite">

    <!-- INTERFACE -->
    <cc:interface>
        <cc:attribute name="id" /> 
        <cc:attribute name="styleButtons" /> 
        <cc:attribute name="tituloDialog" /> 
        <cc:attribute name="textoDialog" /> 
        <cc:attribute name="labelSim" /> 
        <cc:attribute name="labelNao" />
        <cc:attribute name="update" required="true" />
        <cc:attribute name="actionRemover" required="true"
                      method-signature="java.lang.Void action()" />
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>
        <c:set var="cid" value="#{cc.attrs.id}_widvar" />
        <c:set var="title" value="#{empty cc.attrs.tituloDialog ? msgs['acao.excluir'] : cc.attrs.tituloDialog}" />
        <h:form prependId="false">
            <p:dialog header="#{title}" modal="true"
                      widgetVar="#{cid}" resizable="false"
                      appendToBody="true" draggable="false" width="300" height="120">
                <h:outputText value="#{empty cc.attrs.textoDialog ? msgs['msg.deletar'] : cc.attrs.textoDialog}" />
                <div style="height: 6px;" />
                <h:panelGroup layout="block" style="text-align: center;">
                    <p:commandButton value="#{empty cc.attrs.labelSim ? msgs['campo.sim'] : cc.attrs.labelSim}"
                                     process="@this" update="#{cc.attrs.update}"
                                     oncomplete="#{cid}.hide();"
                                     action="#{cc.attrs.actionRemover}" />
                    <p:commandButton value="#{empty cc.attrs.labelNao ? msgs['campo.nao'] : cc.attrs.labelNao}"
                                     process="@this" styleClass="#{cc.attrs.styleButtons}"
                                     onclick="#{cid}.hide();"  />
                </h:panelGroup>
            </p:dialog>
        </h:form>
    </cc:implementation>
</html>